Auto merge of #4155 - ketralnis:fossil, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 14 Jun 2017 03:33:46 +0000 (03:33 +0000)
committerbors <bors@rust-lang.org>
Wed, 14 Jun 2017 03:33:46 +0000 (03:33 +0000)
Add fossil VCS support to `cargo new`

Fossil is a simple, high-reliability, distributed software configuration management system <https://www.fossil-scm.org/>

I mostly followed https://github.com/rust-lang/cargo/pull/3842 as a template. Like that one, this only adds support for `cargo new`, not for pulling down fossil-hosted dependencies

A problem that i didn't tackle but I'd be willing to is a little more more `trait`ifying of the VCSs. I would need some guidance on that since it looks like git has some more thorough support than e.g. hg does but it looks pretty doable

1  2 
src/bin/new.rs
src/cargo/ops/cargo_new.rs

diff --cc src/bin/new.rs
Simple merge
index 8cd4be2241e9d1fb6ca9da0a7c5f592adbafa706,b41aee94adecf1fe327dbac9eab7805b8c99222b..cd88e52a125b9e64f6ab4e57295bec8819c6ea2d
@@@ -50,11 -49,11 +50,12 @@@ impl<'de> Deserialize<'de> for VersionC
              "git" => VersionControl::Git,
              "hg" => VersionControl::Hg,
              "pijul" => VersionControl::Pijul,
+             "fossil" => VersionControl::Fossil,
              "none" => VersionControl::NoVcs,
              n => {
 -                let err = format!("could not decode '{}' as version control", n);
 -                return Err(d.error(&err));
 +                let value = de::Unexpected::Str(n);
 +                let msg = "unsupported version control system";
 +                return Err(de::Error::invalid_value(value, &msg));
              }
          })
      }